package gui;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.InetAddress;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.table.TableModel;

import com.audiobuddy.serializables.Song;


import domain.ClientDomainController;

public class GuiController {

	private ClientDomainController dc;
	private ClientMainJFrame frame;
	private ClientStartUpFrame startUpFrame;

	public GuiController(ClientDomainController clientDomainController) {
		this.dc = clientDomainController;
		this.startGui();
	}

	private void startGui() {
		frame = new ClientMainJFrame(this);
		startUpFrame = new ClientStartUpFrame(this);
	}

	public TableModel getSongTableModel() {
		return dc.getSongTableModel();
	}

	public void addSong(Song song) {
		dc.addSong(song);
		
	}

	public void refreshList() {
		dc.requestCurrentPlaylist();
		
	}

	public void playSong(int row) {
		dc.playSong(row);
		
	}

	public void stop() {
		dc.stopSong();
		
	}

	public void next() {
		dc.nextSong();
		
	}

	public void previous() {
		dc.previousSong();
		
	}

	public void showCurrentSong(String current) {
		frame.showCurrentSong(current);
		
	}

	public void foundServerIp() {
		startUpFrame.stopSearching();
		
	}

	public InetAddress getServerIp() {
		return dc.getServerIp();
	}

	public void delete(int row) {
		dc.delete(row);
		
	}

	
	
	

}
